﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using qlbansach_thuctapnhom.DAL;
using qlbansach_thuctapnhom.BLL;
namespace qlbansach_thuctapnhom.form
{
    public partial class formdangnhap : Form
    {
        public formdangnhap()
        {
            InitializeComponent();
        }
        Login_bll lg = new Login_bll();
        private void btlogin_Click(object sender, EventArgs e)
        {
         bool ok=   lg.kiemtradangnhap(txtTen.Text,txtMatkhau.Text);
         if (ok)
         {
             formchinh fc = new formchinh();
             fc.Show();
             this.Hide();
         }
         else MessageBox.Show("Đăng nhập thất bại", "thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        private void btthoat_Click(object sender, EventArgs e)
        {
            Close();
            Application.Exit();
        }
    }
}
